import request from '@/utils/request'

export function listMechanism(query) {
  return request({
    url: '/mechanism/list',
    method: 'get',
    params: query
  })
}

export function createMechanism(data) {
  return request({
    url: '/mechanism/create',
    method: 'post',
    data
  })
}

export function listMechanisLevel() {
  return request({
    url: '/mechanism/listLevel',
    method: 'get'
  })
}

export function getLevel(query) {
  return request({
    url: '/mechanism/getLevel',
    method: 'get',
    params: query
  })
}

export function sendConfirmCode(query) {
  return request({
    url: '/mechanism/sendConfirmCode',
    method: 'get',
    params: query
  })
}

export function goNoCheck(query) {
  return request({
    url: '/mechanism/goNoCheck',
    method: 'get',
    params: query
  })
}

export function queryMechanismMeg(query) {
  return request({
    url: '/mechanism/queryMechanismMeg',
    method: 'get',
    params: query
  })
}

export function queryCheckMeg(query) {
  return request({
    url: '/mechanism/queryCheckMeg',
    method: 'get',
    params: query
  })
}

// 查询到是否快到到期时间了
export function timeWarn(query) {
  return request({
    url: '/mechanism/timewarn',
    method: 'get',
    params: query
  })
}

export function updateMechanismProxy(data) {
  return request({
    url: '/mechanism/updateproxy',
    method: 'post',
    data
  })
}

// 修改密码
export function updatePassword(data) {
  return request({
    url: '/mechanism/updatePassword',
    method: 'post',
    data
  })
}

// 获取代理机构名称
export function getMechanismName(query) {
  return request({
    url: '/mechanism/merchanismName',
    method: 'get',
    params: query
  })
}

export function readMechanism(data) {
  return request({
    url: '/mechanism/read',
    method: 'get',
    data
  })
}

export function updateMechanism(data) {
  return request({
    url: '/mechanism/update',
    method: 'post',
    data
  })
}

export function deleteMechanism(data) {
  return request({
    url: '/mechanism/delete',
    method: 'post',
    data
  })
}

export function listUserData(query) {
  return request({
    url: '/mechanism/listUserData',
    method: 'get',
    params: query
  })
}

export function updateBalance(query) {
  return request({
    url: '/mechanism/updateBalance',
    method: 'get',
    params: query
  })
}
